#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;
// prority_queue<int, vecotr<int>, greater<int>> pq;

void solve() {
    int n;
    cin >> n;
    __int128 l = 1, r = n + 1;
    auto check = [&](__int128 x) {
        __int128 t = (x * (x - 1)) / 2;
        return t > n;
    };
    while(l < r) {
        __int128 mid = l + r >> 1;
        if(check(mid)) r = mid;
        else l = mid + 1;
    }
    l--;
    int p = l;
    // cout << p << endl;
    int t = ((p - 1) * p) / 2;
    // cout << t << endl;
    cout << p + n - t << endl;
}

signed main() {
    int t; cin >> t;
    while(t--) solve();
    return 0;
}